package com.gongye.courseselectionsystem.config;


import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import java.util.ArrayList;


/**
 * swagger配置类
 *
 * @author baorongchuan
 */
@Configuration
@EnableSwagger2
public class SwaggerConfig {
    /**
     * 创建Swagger2的Docket实例
     */
    @Bean
    public Docket docket() {
        return new Docket(DocumentationType.SWAGGER_2).groupName("包容川").apiInfo(apiInfo());
    }

    /**
     * 配置apiInfo
     */
    private ApiInfo apiInfo() {
        Contact contact = new Contact("包容川", "https://www.baidu.com", "525224912qq.com");
        return new ApiInfo(
                "包容川的文档",
                " 考核项目，学生选课系统",
                "2.0",
                "urn:tos",
                contact,
                "Apache 2.0",
                "http://www.apache.org/licenses/LICENSE-2.0",
                new ArrayList());
    }
}